package org.apache.commons.httpclient;

import java.util.ArrayList;
import java.util.List;
import org.apache.commons.httpclient.util.ParameterParser;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class HeaderElement extends NameValuePair
{
  private static final Log LOG;
  static Class class$org$apache$commons$httpclient$HeaderElement;
  private NameValuePair[] parameters;

  static
  {
    Class localClass;
    if (class$org$apache$commons$httpclient$HeaderElement == null)
    {
      localClass = class$("org.apache.commons.httpclient.HeaderElement");
      class$org$apache$commons$httpclient$HeaderElement = localClass;
    }
    while (true)
    {
      LOG = LogFactory.getLog(localClass);
      return;
      localClass = class$org$apache$commons$httpclient$HeaderElement;
    }
  }

  public HeaderElement()
  {
    this(null, null, null);
  }

  public HeaderElement(String paramString1, String paramString2)
  {
    this(paramString1, paramString2, null);
  }

  public HeaderElement(String paramString1, String paramString2, NameValuePair[] paramArrayOfNameValuePair)
  {
    super(paramString1, paramString2);
    this.parameters = null;
    this.parameters = paramArrayOfNameValuePair;
  }

  public HeaderElement(char[] paramArrayOfChar)
  {
    this(paramArrayOfChar, 0, paramArrayOfChar.length);
  }

  public HeaderElement(char[] paramArrayOfChar, int paramInt1, int paramInt2)
  {
    if (paramArrayOfChar == null);
    while (true)
    {
      return;
      List localList = new ParameterParser().parse(paramArrayOfChar, paramInt1, paramInt2, ';');
      if (localList.size() <= 0)
        continue;
      NameValuePair localNameValuePair = (NameValuePair)localList.remove(0);
      setName(localNameValuePair.getName());
      setValue(localNameValuePair.getValue());
      if (localList.size() <= 0)
        continue;
      this.parameters = ((NameValuePair[])(NameValuePair[])localList.toArray(new NameValuePair[localList.size()]));
    }
  }

  static Class class$(String paramString)
  {
    try
    {
      Class localClass = Class.forName(paramString);
      return localClass;
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }

  public static final HeaderElement[] parse(String paramString)
    throws HttpException
  {
    LOG.trace("enter HeaderElement.parse(String)");
    if (paramString == null);
    for (HeaderElement[] arrayOfHeaderElement = new HeaderElement[0]; ; arrayOfHeaderElement = parseElements(paramString.toCharArray()))
      return arrayOfHeaderElement;
  }

  public static final HeaderElement[] parseElements(String paramString)
  {
    LOG.trace("enter HeaderElement.parseElements(String)");
    if (paramString == null);
    for (HeaderElement[] arrayOfHeaderElement = new HeaderElement[0]; ; arrayOfHeaderElement = parseElements(paramString.toCharArray()))
      return arrayOfHeaderElement;
  }

  public static final HeaderElement[] parseElements(char[] paramArrayOfChar)
  {
    LOG.trace("enter HeaderElement.parseElements(char[])");
    if (paramArrayOfChar == null);
    ArrayList localArrayList;
    for (HeaderElement[] arrayOfHeaderElement = new HeaderElement[0]; ; arrayOfHeaderElement = (HeaderElement[])(HeaderElement[])localArrayList.toArray(new HeaderElement[localArrayList.size()]))
    {
      return arrayOfHeaderElement;
      localArrayList = new ArrayList();
      int i = 0;
      int j = 0;
      int k = paramArrayOfChar.length;
      int l = 0;
      label42: if (i >= k)
        continue;
      int i1 = paramArrayOfChar[i];
      if (i1 == 34)
      {
        if (l != 0)
          break label127;
        l = 1;
      }
      label68: HeaderElement localHeaderElement = null;
      if ((l == 0) && (i1 == 44))
      {
        localHeaderElement = new HeaderElement(paramArrayOfChar, j, i);
        j = i + 1;
      }
      while (true)
      {
        if ((localHeaderElement != null) && (localHeaderElement.getName() != null))
          localArrayList.add(localHeaderElement);
        ++i;
        break label42:
        label127: l = 0;
        break label68:
        if (i != k - 1)
          continue;
        localHeaderElement = new HeaderElement(paramArrayOfChar, j, k);
      }
    }
  }

  public NameValuePair getParameterByName(String paramString)
  {
    LOG.trace("enter HeaderElement.getParameterByName(String)");
    if (paramString == null)
      throw new IllegalArgumentException("Name may not be null");
    Object localObject = null;
    NameValuePair[] arrayOfNameValuePair = getParameters();
    if (arrayOfNameValuePair != null);
    for (int i = 0; ; ++i)
    {
      if (i < arrayOfNameValuePair.length)
      {
        NameValuePair localNameValuePair = arrayOfNameValuePair[i];
        if (!(localNameValuePair.getName().equalsIgnoreCase(paramString)))
          continue;
        localObject = localNameValuePair;
      }
      return localObject;
    }
  }

  public NameValuePair[] getParameters()
  {
    return this.parameters;
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     org.apache.commons.httpclient.HeaderElement
 * JD-Core Version:    0.5.3
 */